\(\int \cos (c+d x) (a+a \cos (c+d x))^3 (A+C \cos ^2(c+d x)) \, dx\) [19]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 31, antiderivative size = 188 \[ \int \cos (c+d x) (a+a \cos (c+d x))^3 \left (A+C \cos ^2(c+d x)\right ) \, dx=\frac {1}{16} a^3 (30 A+23 C) x+\frac {a^3 (30 A+23 C) \sin (c+d x)}{10 d}+\frac {3 a^3 (30 A+23 C) \cos (c+d x) \sin (c+d x)}{80 d}+\frac {(30 A+7 C) (a+a \cos (c+d x))^3 \sin (c+d x)}{120 d}+\frac {C \cos ^2(c+d x) (a+a \cos (c+d x))^3 \sin (c+d x)}{6 d}+\frac {C (a+a \cos (c+d x))^4 \sin (c+d x)}{10 a d}-\frac {a^3 (30 A+23 C) \sin ^3(c+d x)}{120 d} \]

[Out]

1/16*a^3*(30*A+23*C)*x+1/10*a^3*(30*A+23*C)*sin(d*x+c)/d+3/80*a^3*(30*A+23*C)*cos(d*x+c)*sin(d*x+c)/d+1/120*(3
0*A+7*C)*(a+a*cos(d*x+c))^3*sin(d*x+c)/d+1/6*C*cos(d*x+c)^2*(a+a*cos(d*x+c))^3*sin(d*x+c)/d+1/10*C*(a+a*cos(d*
x+c))^4*sin(d*x+c)/a/d-1/120*a^3*(30*A+23*C)*sin(d*x+c)^3/d

Rubi [A] (verified)

Time = 0.44 (sec) , antiderivative size = 188, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.290, Rules used = {3125, 3047, 3102, 2830, 2724, 2717, 2715, 8, 2713} \[ \int \cos (c+d x) (a+a \cos (c+d x))^3 \left (A+C \cos ^2(c+d x)\right ) \, dx=-\frac {a^3 (30 A+23 C) \sin ^3(c+d x)}{120 d}+\frac {a^3 (30 A+23 C) \sin (c+d x)}{10 d}+\frac {3 a^3 (30 A+23 C) \sin (c+d x) \cos (c+d x)}{80 d}+\frac {1}{16} a^3 x (30 A+23 C)+\frac {(30 A+7 C) \sin (c+d x) (a \cos (c+d x)+a)^3}{120 d}+\frac {C \sin (c+d x) \cos ^2(c+d x) (a \cos (c+d x)+a)^3}{6 d}+\frac {C \sin (c+d x) (a \cos (c+d x)+a)^4}{10 a d} \]

[In]

Int[Cos[c + d*x]*(a + a*Cos[c + d*x])^3*(A + C*Cos[c + d*x]^2),x]

[Out]

(a^3*(30*A + 23*C)*x)/16 + (a^3*(30*A + 23*C)*Sin[c + d*x])/(10*d) + (3*a^3*(30*A + 23*C)*Cos[c + d*x]*Sin[c +
 d*x])/(80*d) + ((30*A + 7*C)*(a + a*Cos[c + d*x])^3*Sin[c + d*x])/(120*d) + (C*Cos[c + d*x]^2*(a + a*Cos[c +
d*x])^3*Sin[c + d*x])/(6*d) + (C*(a + a*Cos[c + d*x])^4*Sin[c + d*x])/(10*a*d) - (a^3*(30*A + 23*C)*Sin[c + d*
x]^3)/(120*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2713

Int[sin[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[Expand[(1 - x^2)^((n - 1)/2), x], x], x
, Cos[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[(n - 1)/2, 0]

Rule 2715

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Sin[c + d*x])^(n - 1)/(d*n))
, x] + Dist[b^2*((n - 1)/n), Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integ
erQ[2*n]

Rule 2717

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 2724

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Int[ExpandTrig[(a + b*sin[c + d*x])^n, x], x] /;
 FreeQ[{a, b, c, d, n}, x] && EqQ[a^2 - b^2, 0] && IGtQ[n, 0]

Rule 2830

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-d
)*Cos[e + f*x]*((a + b*Sin[e + f*x])^m/(f*(m + 1))), x] + Dist[(a*d*m + b*c*(m + 1))/(b*(m + 1)), Int[(a + b*S
in[e + f*x])^m, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] &&  !LtQ[m
, -2^(-1)]

Rule 3047

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(
e_.) + (f_.)*(x_)]), x_Symbol] :> Int[(a + b*Sin[e + f*x])^m*(A*c + (B*c + A*d)*Sin[e + f*x] + B*d*Sin[e + f*x
]^2), x] /; FreeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0]

Rule 3102

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (
f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Cos[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Dist[1/(
b*(m + 2)), Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m + 2) - a*C)*Sin[e + f*x], x],
x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] &&  !LtQ[m, -1]

Rule 3125

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((A_.) + (C_.)*
sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Cos[e + f*x]*(a + b*Sin[e + f*x])^m*((c + d*Sin[e + f*x])^(
n + 1)/(d*f*(m + n + 2))), x] + Dist[1/(b*d*(m + n + 2)), Int[(a + b*Sin[e + f*x])^m*(c + d*Sin[e + f*x])^n*Si
mp[A*b*d*(m + n + 2) + C*(a*c*m + b*d*(n + 1)) + C*(a*d*m - b*c*(m + 1))*Sin[e + f*x], x], x], x] /; FreeQ[{a,
 b, c, d, e, f, A, C, m, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] &&  !LtQ[m, -2^
(-1)] && NeQ[m + n + 2, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {C \cos ^2(c+d x) (a+a \cos (c+d x))^3 \sin (c+d x)}{6 d}+\frac {\int \cos (c+d x) (a+a \cos (c+d x))^3 (2 a (3 A+C)+3 a C \cos (c+d x)) \, dx}{6 a} \\ & = \frac {C \cos ^2(c+d x) (a+a \cos (c+d x))^3 \sin (c+d x)}{6 d}+\frac {\int (a+a \cos (c+d x))^3 \left (2 a (3 A+C) \cos (c+d x)+3 a C \cos ^2(c+d x)\right ) \, dx}{6 a} \\ & = \frac {C \cos ^2(c+d x) (a+a \cos (c+d x))^3 \sin (c+d x)}{6 d}+\frac {C (a+a \cos (c+d x))^4 \sin (c+d x)}{10 a d}+\frac {\int (a+a \cos (c+d x))^3 \left (12 a^2 C+a^2 (30 A+7 C) \cos (c+d x)\right ) \, dx}{30 a^2} \\ & = \frac {(30 A+7 C) (a+a \cos (c+d x))^3 \sin (c+d x)}{120 d}+\frac {C \cos ^2(c+d x) (a+a \cos (c+d x))^3 \sin (c+d x)}{6 d}+\frac {C (a+a \cos (c+d x))^4 \sin (c+d x)}{10 a d}+\frac {1}{40} (30 A+23 C) \int (a+a \cos (c+d x))^3 \, dx \\ & = \frac {(30 A+7 C) (a+a \cos (c+d x))^3 \sin (c+d x)}{120 d}+\frac {C \cos ^2(c+d x) (a+a \cos (c+d x))^3 \sin (c+d x)}{6 d}+\frac {C (a+a \cos (c+d x))^4 \sin (c+d x)}{10 a d}+\frac {1}{40} (30 A+23 C) \int \left (a^3+3 a^3 \cos (c+d x)+3 a^3 \cos ^2(c+d x)+a^3 \cos ^3(c+d x)\right ) \, dx \\ & = \frac {1}{40} a^3 (30 A+23 C) x+\frac {(30 A+7 C) (a+a \cos (c+d x))^3 \sin (c+d x)}{120 d}+\frac {C \cos ^2(c+d x) (a+a \cos (c+d x))^3 \sin (c+d x)}{6 d}+\frac {C (a+a \cos (c+d x))^4 \sin (c+d x)}{10 a d}+\frac {1}{40} \left (a^3 (30 A+23 C)\right ) \int \cos ^3(c+d x) \, dx+\frac {1}{40} \left (3 a^3 (30 A+23 C)\right ) \int \cos (c+d x) \, dx+\frac {1}{40} \left (3 a^3 (30 A+23 C)\right ) \int \cos ^2(c+d x) \, dx \\ & = \frac {1}{40} a^3 (30 A+23 C) x+\frac {3 a^3 (30 A+23 C) \sin (c+d x)}{40 d}+\frac {3 a^3 (30 A+23 C) \cos (c+d x) \sin (c+d x)}{80 d}+\frac {(30 A+7 C) (a+a \cos (c+d x))^3 \sin (c+d x)}{120 d}+\frac {C \cos ^2(c+d x) (a+a \cos (c+d x))^3 \sin (c+d x)}{6 d}+\frac {C (a+a \cos (c+d x))^4 \sin (c+d x)}{10 a d}+\frac {1}{80} \left (3 a^3 (30 A+23 C)\right ) \int 1 \, dx-\frac {\left (a^3 (30 A+23 C)\right ) \text {Subst}\left (\int \left (1-x^2\right ) \, dx,x,-\sin (c+d x)\right )}{40 d} \\ & = \frac {1}{16} a^3 (30 A+23 C) x+\frac {a^3 (30 A+23 C) \sin (c+d x)}{10 d}+\frac {3 a^3 (30 A+23 C) \cos (c+d x) \sin (c+d x)}{80 d}+\frac {(30 A+7 C) (a+a \cos (c+d x))^3 \sin (c+d x)}{120 d}+\frac {C \cos ^2(c+d x) (a+a \cos (c+d x))^3 \sin (c+d x)}{6 d}+\frac {C (a+a \cos (c+d x))^4 \sin (c+d x)}{10 a d}-\frac {a^3 (30 A+23 C) \sin ^3(c+d x)}{120 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.25 (sec) , antiderivative size = 123, normalized size of antiderivative = 0.65 \[ \int \cos (c+d x) (a+a \cos (c+d x))^3 \left (A+C \cos ^2(c+d x)\right ) \, dx=\frac {a^3 (900 c C+1800 A d x+1380 C d x+120 (26 A+21 C) \sin (c+d x)+15 (64 A+63 C) \sin (2 (c+d x))+240 A \sin (3 (c+d x))+380 C \sin (3 (c+d x))+30 A \sin (4 (c+d x))+135 C \sin (4 (c+d x))+36 C \sin (5 (c+d x))+5 C \sin (6 (c+d x)))}{960 d} \]

[In]

Integrate[Cos[c + d*x]*(a + a*Cos[c + d*x])^3*(A + C*Cos[c + d*x]^2),x]

[Out]

(a^3*(900*c*C + 1800*A*d*x + 1380*C*d*x + 120*(26*A + 21*C)*Sin[c + d*x] + 15*(64*A + 63*C)*Sin[2*(c + d*x)] +
 240*A*Sin[3*(c + d*x)] + 380*C*Sin[3*(c + d*x)] + 30*A*Sin[4*(c + d*x)] + 135*C*Sin[4*(c + d*x)] + 36*C*Sin[5
*(c + d*x)] + 5*C*Sin[6*(c + d*x)]))/(960*d)

Maple [A] (verified)

Time = 7.28 (sec) , antiderivative size = 106, normalized size of antiderivative = 0.56

method result size
parallelrisch \(\frac {\left (\left (32 A +\frac {63 C}{2}\right ) \sin \left (2 d x +2 c \right )+\left (8 A +\frac {38 C}{3}\right ) \sin \left (3 d x +3 c \right )+\left (A +\frac {9 C}{2}\right ) \sin \left (4 d x +4 c \right )+\frac {6 \sin \left (5 d x +5 c \right ) C}{5}+\frac {\sin \left (6 d x +6 c \right ) C}{6}+\left (104 A +84 C \right ) \sin \left (d x +c \right )+60 \left (A +\frac {23 C}{30}\right ) x d \right ) a^{3}}{32 d}\) \(106\)
risch \(\frac {15 a^{3} A x}{8}+\frac {23 a^{3} C x}{16}+\frac {13 a^{3} A \sin \left (d x +c \right )}{4 d}+\frac {21 a^{3} C \sin \left (d x +c \right )}{8 d}+\frac {C \,a^{3} \sin \left (6 d x +6 c \right )}{192 d}+\frac {3 \sin \left (5 d x +5 c \right ) C \,a^{3}}{80 d}+\frac {\sin \left (4 d x +4 c \right ) A \,a^{3}}{32 d}+\frac {9 \sin \left (4 d x +4 c \right ) C \,a^{3}}{64 d}+\frac {\sin \left (3 d x +3 c \right ) A \,a^{3}}{4 d}+\frac {19 \sin \left (3 d x +3 c \right ) C \,a^{3}}{48 d}+\frac {\sin \left (2 d x +2 c \right ) A \,a^{3}}{d}+\frac {63 \sin \left (2 d x +2 c \right ) C \,a^{3}}{64 d}\) \(189\)
parts \(\frac {\left (A \,a^{3}+3 C \,a^{3}\right ) \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}+\frac {\left (3 A \,a^{3}+C \,a^{3}\right ) \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3 d}+\frac {a^{3} A \sin \left (d x +c \right )}{d}+\frac {C \,a^{3} \left (\frac {\left (\cos ^{5}\left (d x +c \right )+\frac {5 \left (\cos ^{3}\left (d x +c \right )\right )}{4}+\frac {15 \cos \left (d x +c \right )}{8}\right ) \sin \left (d x +c \right )}{6}+\frac {5 d x}{16}+\frac {5 c}{16}\right )}{d}+\frac {3 A \,a^{3} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {3 C \,a^{3} \left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{5 d}\) \(215\)
derivativedivides \(\frac {A \,a^{3} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+C \,a^{3} \left (\frac {\left (\cos ^{5}\left (d x +c \right )+\frac {5 \left (\cos ^{3}\left (d x +c \right )\right )}{4}+\frac {15 \cos \left (d x +c \right )}{8}\right ) \sin \left (d x +c \right )}{6}+\frac {5 d x}{16}+\frac {5 c}{16}\right )+A \,a^{3} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )+\frac {3 C \,a^{3} \left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{5}+3 A \,a^{3} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+3 C \,a^{3} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+A \,a^{3} \sin \left (d x +c \right )+\frac {C \,a^{3} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}}{d}\) \(245\)
default \(\frac {A \,a^{3} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+C \,a^{3} \left (\frac {\left (\cos ^{5}\left (d x +c \right )+\frac {5 \left (\cos ^{3}\left (d x +c \right )\right )}{4}+\frac {15 \cos \left (d x +c \right )}{8}\right ) \sin \left (d x +c \right )}{6}+\frac {5 d x}{16}+\frac {5 c}{16}\right )+A \,a^{3} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )+\frac {3 C \,a^{3} \left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{5}+3 A \,a^{3} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+3 C \,a^{3} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+A \,a^{3} \sin \left (d x +c \right )+\frac {C \,a^{3} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}}{d}\) \(245\)
norman \(\frac {\frac {a^{3} \left (30 A +23 C \right ) x}{16}+\frac {7 a^{3} \left (14 A +15 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{8 d}+\frac {33 a^{3} \left (30 A +23 C \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{20 d}+\frac {17 a^{3} \left (30 A +23 C \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{24 d}+\frac {a^{3} \left (30 A +23 C \right ) \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d}+\frac {3 a^{3} \left (30 A +23 C \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8}+\frac {15 a^{3} \left (30 A +23 C \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{16}+\frac {5 a^{3} \left (30 A +23 C \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4}+\frac {15 a^{3} \left (30 A +23 C \right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{16}+\frac {3 a^{3} \left (30 A +23 C \right ) x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8}+\frac {a^{3} \left (30 A +23 C \right ) x \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{16}+\frac {a^{3} \left (342 A +211 C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d}+\frac {a^{3} \left (1250 A +969 C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{20 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{6}}\) \(329\)

[In]

int(cos(d*x+c)*(a+cos(d*x+c)*a)^3*(A+C*cos(d*x+c)^2),x,method=_RETURNVERBOSE)

[Out]

1/32*((32*A+63/2*C)*sin(2*d*x+2*c)+(8*A+38/3*C)*sin(3*d*x+3*c)+(A+9/2*C)*sin(4*d*x+4*c)+6/5*sin(5*d*x+5*c)*C+1
/6*sin(6*d*x+6*c)*C+(104*A+84*C)*sin(d*x+c)+60*(A+23/30*C)*x*d)*a^3/d

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 126, normalized size of antiderivative = 0.67 \[ \int \cos (c+d x) (a+a \cos (c+d x))^3 \left (A+C \cos ^2(c+d x)\right ) \, dx=\frac {15 \, {\left (30 \, A + 23 \, C\right )} a^{3} d x + {\left (40 \, C a^{3} \cos \left (d x + c\right )^{5} + 144 \, C a^{3} \cos \left (d x + c\right )^{4} + 10 \, {\left (6 \, A + 23 \, C\right )} a^{3} \cos \left (d x + c\right )^{3} + 16 \, {\left (15 \, A + 17 \, C\right )} a^{3} \cos \left (d x + c\right )^{2} + 15 \, {\left (30 \, A + 23 \, C\right )} a^{3} \cos \left (d x + c\right ) + 16 \, {\left (45 \, A + 34 \, C\right )} a^{3}\right )} \sin \left (d x + c\right )}{240 \, d} \]

[In]

integrate(cos(d*x+c)*(a+a*cos(d*x+c))^3*(A+C*cos(d*x+c)^2),x, algorithm="fricas")

[Out]

1/240*(15*(30*A + 23*C)*a^3*d*x + (40*C*a^3*cos(d*x + c)^5 + 144*C*a^3*cos(d*x + c)^4 + 10*(6*A + 23*C)*a^3*co
s(d*x + c)^3 + 16*(15*A + 17*C)*a^3*cos(d*x + c)^2 + 15*(30*A + 23*C)*a^3*cos(d*x + c) + 16*(45*A + 34*C)*a^3)
*sin(d*x + c))/d

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 646 vs. \(2 (170) = 340\).

Time = 0.42 (sec) , antiderivative size = 646, normalized size of antiderivative = 3.44 \[ \int \cos (c+d x) (a+a \cos (c+d x))^3 \left (A+C \cos ^2(c+d x)\right ) \, dx=\begin {cases} \frac {3 A a^{3} x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {3 A a^{3} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {3 A a^{3} x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {3 A a^{3} x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {3 A a^{3} x \cos ^{2}{\left (c + d x \right )}}{2} + \frac {3 A a^{3} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} + \frac {2 A a^{3} \sin ^{3}{\left (c + d x \right )}}{d} + \frac {5 A a^{3} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} + \frac {3 A a^{3} \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} + \frac {3 A a^{3} \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} + \frac {A a^{3} \sin {\left (c + d x \right )}}{d} + \frac {5 C a^{3} x \sin ^{6}{\left (c + d x \right )}}{16} + \frac {15 C a^{3} x \sin ^{4}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{16} + \frac {9 C a^{3} x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {15 C a^{3} x \sin ^{2}{\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{16} + \frac {9 C a^{3} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {5 C a^{3} x \cos ^{6}{\left (c + d x \right )}}{16} + \frac {9 C a^{3} x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {5 C a^{3} \sin ^{5}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{16 d} + \frac {8 C a^{3} \sin ^{5}{\left (c + d x \right )}}{5 d} + \frac {5 C a^{3} \sin ^{3}{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{6 d} + \frac {4 C a^{3} \sin ^{3}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} + \frac {9 C a^{3} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} + \frac {2 C a^{3} \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac {11 C a^{3} \sin {\left (c + d x \right )} \cos ^{5}{\left (c + d x \right )}}{16 d} + \frac {3 C a^{3} \sin {\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{d} + \frac {15 C a^{3} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} + \frac {C a^{3} \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (A + C \cos ^{2}{\left (c \right )}\right ) \left (a \cos {\left (c \right )} + a\right )^{3} \cos {\left (c \right )} & \text {otherwise} \end {cases} \]

[In]

integrate(cos(d*x+c)*(a+a*cos(d*x+c))**3*(A+C*cos(d*x+c)**2),x)

[Out]

Piecewise((3*A*a**3*x*sin(c + d*x)**4/8 + 3*A*a**3*x*sin(c + d*x)**2*cos(c + d*x)**2/4 + 3*A*a**3*x*sin(c + d*
x)**2/2 + 3*A*a**3*x*cos(c + d*x)**4/8 + 3*A*a**3*x*cos(c + d*x)**2/2 + 3*A*a**3*sin(c + d*x)**3*cos(c + d*x)/
(8*d) + 2*A*a**3*sin(c + d*x)**3/d + 5*A*a**3*sin(c + d*x)*cos(c + d*x)**3/(8*d) + 3*A*a**3*sin(c + d*x)*cos(c
 + d*x)**2/d + 3*A*a**3*sin(c + d*x)*cos(c + d*x)/(2*d) + A*a**3*sin(c + d*x)/d + 5*C*a**3*x*sin(c + d*x)**6/1
6 + 15*C*a**3*x*sin(c + d*x)**4*cos(c + d*x)**2/16 + 9*C*a**3*x*sin(c + d*x)**4/8 + 15*C*a**3*x*sin(c + d*x)**
2*cos(c + d*x)**4/16 + 9*C*a**3*x*sin(c + d*x)**2*cos(c + d*x)**2/4 + 5*C*a**3*x*cos(c + d*x)**6/16 + 9*C*a**3
*x*cos(c + d*x)**4/8 + 5*C*a**3*sin(c + d*x)**5*cos(c + d*x)/(16*d) + 8*C*a**3*sin(c + d*x)**5/(5*d) + 5*C*a**
3*sin(c + d*x)**3*cos(c + d*x)**3/(6*d) + 4*C*a**3*sin(c + d*x)**3*cos(c + d*x)**2/d + 9*C*a**3*sin(c + d*x)**
3*cos(c + d*x)/(8*d) + 2*C*a**3*sin(c + d*x)**3/(3*d) + 11*C*a**3*sin(c + d*x)*cos(c + d*x)**5/(16*d) + 3*C*a*
*3*sin(c + d*x)*cos(c + d*x)**4/d + 15*C*a**3*sin(c + d*x)*cos(c + d*x)**3/(8*d) + C*a**3*sin(c + d*x)*cos(c +
 d*x)**2/d, Ne(d, 0)), (x*(A + C*cos(c)**2)*(a*cos(c) + a)**3*cos(c), True))

Maxima [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 239, normalized size of antiderivative = 1.27 \[ \int \cos (c+d x) (a+a \cos (c+d x))^3 \left (A+C \cos ^2(c+d x)\right ) \, dx=-\frac {960 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} A a^{3} - 30 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} A a^{3} - 720 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A a^{3} - 192 \, {\left (3 \, \sin \left (d x + c\right )^{5} - 10 \, \sin \left (d x + c\right )^{3} + 15 \, \sin \left (d x + c\right )\right )} C a^{3} + 5 \, {\left (4 \, \sin \left (2 \, d x + 2 \, c\right )^{3} - 60 \, d x - 60 \, c - 9 \, \sin \left (4 \, d x + 4 \, c\right ) - 48 \, \sin \left (2 \, d x + 2 \, c\right )\right )} C a^{3} + 320 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} C a^{3} - 90 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} C a^{3} - 960 \, A a^{3} \sin \left (d x + c\right )}{960 \, d} \]

[In]

integrate(cos(d*x+c)*(a+a*cos(d*x+c))^3*(A+C*cos(d*x+c)^2),x, algorithm="maxima")

[Out]

-1/960*(960*(sin(d*x + c)^3 - 3*sin(d*x + c))*A*a^3 - 30*(12*d*x + 12*c + sin(4*d*x + 4*c) + 8*sin(2*d*x + 2*c
))*A*a^3 - 720*(2*d*x + 2*c + sin(2*d*x + 2*c))*A*a^3 - 192*(3*sin(d*x + c)^5 - 10*sin(d*x + c)^3 + 15*sin(d*x
 + c))*C*a^3 + 5*(4*sin(2*d*x + 2*c)^3 - 60*d*x - 60*c - 9*sin(4*d*x + 4*c) - 48*sin(2*d*x + 2*c))*C*a^3 + 320
*(sin(d*x + c)^3 - 3*sin(d*x + c))*C*a^3 - 90*(12*d*x + 12*c + sin(4*d*x + 4*c) + 8*sin(2*d*x + 2*c))*C*a^3 -
960*A*a^3*sin(d*x + c))/d

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 158, normalized size of antiderivative = 0.84 \[ \int \cos (c+d x) (a+a \cos (c+d x))^3 \left (A+C \cos ^2(c+d x)\right ) \, dx=\frac {C a^{3} \sin \left (6 \, d x + 6 \, c\right )}{192 \, d} + \frac {3 \, C a^{3} \sin \left (5 \, d x + 5 \, c\right )}{80 \, d} + \frac {1}{16} \, {\left (30 \, A a^{3} + 23 \, C a^{3}\right )} x + \frac {{\left (2 \, A a^{3} + 9 \, C a^{3}\right )} \sin \left (4 \, d x + 4 \, c\right )}{64 \, d} + \frac {{\left (12 \, A a^{3} + 19 \, C a^{3}\right )} \sin \left (3 \, d x + 3 \, c\right )}{48 \, d} + \frac {{\left (64 \, A a^{3} + 63 \, C a^{3}\right )} \sin \left (2 \, d x + 2 \, c\right )}{64 \, d} + \frac {{\left (26 \, A a^{3} + 21 \, C a^{3}\right )} \sin \left (d x + c\right )}{8 \, d} \]

[In]

integrate(cos(d*x+c)*(a+a*cos(d*x+c))^3*(A+C*cos(d*x+c)^2),x, algorithm="giac")

[Out]

1/192*C*a^3*sin(6*d*x + 6*c)/d + 3/80*C*a^3*sin(5*d*x + 5*c)/d + 1/16*(30*A*a^3 + 23*C*a^3)*x + 1/64*(2*A*a^3
+ 9*C*a^3)*sin(4*d*x + 4*c)/d + 1/48*(12*A*a^3 + 19*C*a^3)*sin(3*d*x + 3*c)/d + 1/64*(64*A*a^3 + 63*C*a^3)*sin
(2*d*x + 2*c)/d + 1/8*(26*A*a^3 + 21*C*a^3)*sin(d*x + c)/d

Mupad [B] (verification not implemented)

Time = 2.59 (sec) , antiderivative size = 315, normalized size of antiderivative = 1.68 \[ \int \cos (c+d x) (a+a \cos (c+d x))^3 \left (A+C \cos ^2(c+d x)\right ) \, dx=\frac {\left (\frac {15\,A\,a^3}{4}+\frac {23\,C\,a^3}{8}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}+\left (\frac {85\,A\,a^3}{4}+\frac {391\,C\,a^3}{24}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+\left (\frac {99\,A\,a^3}{2}+\frac {759\,C\,a^3}{20}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (\frac {125\,A\,a^3}{2}+\frac {969\,C\,a^3}{20}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (\frac {171\,A\,a^3}{4}+\frac {211\,C\,a^3}{8}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (\frac {49\,A\,a^3}{4}+\frac {105\,C\,a^3}{8}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+15\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+20\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+15\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}-\frac {a^3\,\left (30\,A+23\,C\right )\,\left (\mathrm {atan}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )-\frac {d\,x}{2}\right )}{8\,d}+\frac {a^3\,\mathrm {atan}\left (\frac {a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (30\,A+23\,C\right )}{8\,\left (\frac {15\,A\,a^3}{4}+\frac {23\,C\,a^3}{8}\right )}\right )\,\left (30\,A+23\,C\right )}{8\,d} \]

[In]

int(cos(c + d*x)*(A + C*cos(c + d*x)^2)*(a + a*cos(c + d*x))^3,x)

[Out]

(tan(c/2 + (d*x)/2)*((49*A*a^3)/4 + (105*C*a^3)/8) + tan(c/2 + (d*x)/2)^11*((15*A*a^3)/4 + (23*C*a^3)/8) + tan
(c/2 + (d*x)/2)^3*((171*A*a^3)/4 + (211*C*a^3)/8) + tan(c/2 + (d*x)/2)^9*((85*A*a^3)/4 + (391*C*a^3)/24) + tan
(c/2 + (d*x)/2)^7*((99*A*a^3)/2 + (759*C*a^3)/20) + tan(c/2 + (d*x)/2)^5*((125*A*a^3)/2 + (969*C*a^3)/20))/(d*
(6*tan(c/2 + (d*x)/2)^2 + 15*tan(c/2 + (d*x)/2)^4 + 20*tan(c/2 + (d*x)/2)^6 + 15*tan(c/2 + (d*x)/2)^8 + 6*tan(
c/2 + (d*x)/2)^10 + tan(c/2 + (d*x)/2)^12 + 1)) - (a^3*(30*A + 23*C)*(atan(tan(c/2 + (d*x)/2)) - (d*x)/2))/(8*
d) + (a^3*atan((a^3*tan(c/2 + (d*x)/2)*(30*A + 23*C))/(8*((15*A*a^3)/4 + (23*C*a^3)/8)))*(30*A + 23*C))/(8*d)